package client.messageContent;

import common.CurrencyEnum;
import common.SerializationManager;
import common.data.CreateAccountAgrs;
import common.interfaces.MessageContent;

public class CreateAccountMsgContent extends CreateAccountAgrs implements MessageContent{
	private int length;
	private byte[] data;
	public CreateAccountMsgContent(String holderName, String password,
			CurrencyEnum currency, float balance) {
		this.setHolderName(holderName);
		this.setPassword(password);
		this.setCurrency(currency);
		this.setBalance(balance);
	}

	@Override
	public byte[] getByte(){
		try {
			data = SerializationManager.getCurrent().fromObject(this);
		} catch (IllegalArgumentException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;		
	}

	@Override
	public int getLength() {
		return this.length;
	}
}
